#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''=================================================
@Project -> File   ：FastRiteApi -> publish
@IDE    ：PyCharm
@Author ：Json
@Date   ：2025/3/24 11:37
@Desc   ：
=================================================='''

import sys
import subprocess

"""
git add .
git commit -m "add"
python -m build    # pip install "setuptools>=61.0,<65.0" wheel build==0.10.0
git push -u origin master
"""
def main():
    message = sys.argv[1] if len(sys.argv) > 1 else "auto commit"
    subprocess.run(["python", "-m", "build"])
    subprocess.run(["git", "add", "."])
    subprocess.run(["git", "commit", "-m", message])
    subprocess.run(["git", "push", "origin", "master"])


if __name__ == "__main__":
    main()